function remove(obj, size)
{
	var removeForm = document.getElementById("removeForm");
	removeForm.course.value = obj.id;
	$(removeForm).submit();
	$('#trOfTable'+size).fadeOut("slow");
}

function removeFromView(obj)
{
	var removeForm = document.getElementById("removeForm");
	removeForm.course.value = obj.id;
	$(removeForm).submit();
	$('#regUnregView').fadeOut("slow");
}

function removeSelected(myCoursesSize)
{
	var selectedForm = document.getElementById("removeSelectedForm");
	if(myCoursesSize == 1)
	{
		var elem = document.getElementsByTagName('input')[0];
		var removeForm = document.getElementById("removeForm");
		removeForm.course.value = elem.value;
		if(elem.checked)
			$(removeForm).submit();
		$('#trOfTable0').fadeOut("slow");
		return;
	}
	var length = 0;
	var coursesForm = document.getElementById("coursesForm");
	for (var i=0; i < coursesForm.option.length; i++)
	   if (coursesForm.option[i].checked)
		 {
			var selected = document.createElement('input');
			selected.setAttribute('type', 'hidden');
			selected.setAttribute('name', 'course'+length);
			selected.setAttribute('id', 'course'+length);
			selected.setAttribute('value', coursesForm.option[i].value);
			selectedForm.appendChild(selected);
			length = length + 1;
		 }
	var selLength = document.createElement('input');
	selLength.setAttribute('type', 'hidden');
	selLength.setAttribute('name', 'selLength');
	selLength.setAttribute('id', 'selLength');
	selLength.setAttribute('value', length);
	selectedForm.appendChild(selLength);
	$('#removeSelectedForm').submit();
	for (var i=0; i < coursesForm.option.length; i++)
		if (coursesForm.option[i].checked)
			$('#trOfTable'+i).fadeOut("slow");
}
